package MyOop04;

import java.util.Scanner;

/**
 * 需求：键盘录入一个字符串，使用程序实现在控制台遍历改字符串
 */
public class StringDemo002 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个字符串：");
        String str1 = sc.next();
        for (int i = 0; i < str1.length(); i++) {
            char s = str1.charAt(i);
            System.out.println(s);
        }
    }
}
